package com.kaigejava.singleton;

/**
 * Created by kaigejava on 2019/8/21.
 * 静态内部了实现方式
 */
public class InnerClassSingleton {

    private  InnerClassSingleton (){}

    /**
     * 内部静态类
     */
    private  static  class  InnerClassSingletonInstance{
        private  static final InnerClassSingleton instance = new InnerClassSingleton();
    }

    /**
     * 内部静态类获取
     * @return
     */
    public  static  InnerClassSingleton getInstance(){
        return InnerClassSingletonInstance.instance;
    }
}
